// 异步模式
const EventEmitter = require('events');

class MyEmitter extends EventEmitter { };

const myEmitter = new MyEmitter();

myEmitter.on('testFun', function (a, b) {
  setImmediate(() => {
    console.log(`${a} + ${b} = ${a + b}`);
    console.log('执行完毕')
  })
})


myEmitter.emit('testFun', 3, 5)

console.log('你异步，我先执行')